This line needs to be `return (not pos.nil?)` or `not pos.nil?`.