Replaced chomp with sub