updated assignment2.2