added another test and changed function