got this passing every test, except that it has weird garbage output when using echo