Assignment 2 String Manipulation Solution