Changed method name from isEqual to isEqualTask
Changed multiple if statements to a clearer structure