Edited for programming assignment 2