complete working without pattern matching