adding in code and output for shorter inputs