Code for program

Initial commit, code needs comments.