Updated prog 2

Fixed some coding issues for functions and added others.