Added code to complete Assignment #2 functions