Added my own functions according the the assignment.