clean-up and implemented inputfilter (closes #4)