fix input pattern matching
reimplement python abbreviation