attempting to write functions that pass the written tests