Completed program

Completed writing program, added test cases