Finished first function

Finished first function for Goal2 Assignment