changed to use unless rather than (when (not prediciate)). dropped unneseccary line