need a much more careful debugging, tracking how cubes are placed