function for assignment 4 completed.
Just style changes.