Accomplished programming assignment 2