Moved iteration over cubes away from evalState call.