broke out separate functions for each type of work