loop and chomp added