added testing for each function