adapting solve.hs to new cube model