Created 2 functions for assignment 2