WIP: the cubes problem. Added traveling logic.