moved Loop class to a different file