Judge gives Castlewood man three life terms for child sex crimes