added function to clean input 

any replacement or stripping of characters should be done in clean($input)