edited programming assignment 2