Added logic functions from the rotation file.