changed nesting again; adjusted return part