Completed the programming exercise