add second function for assignment1