finished programs for Assignment 1