actual solving of the halfslap+torch problem