Man sentenced to 22 years in prison after confessing to murdering ex-wife