added 2 functions for assignment 2