changes to complete programming assignment 2