cleaned up loop contents