First run at implementing a the program for Assignment 2B