removed unnecessary step of adding function return values to a list before testing