Refactored: removed chomp, replaced with joining arrays