re-facotor to test recursive solving of cube