clean up loops