added ifs for last code, still test fails