now have working functions for all three tasks :: need to perform the unit tests