Adding patterns to input