added a sanitizer for the input and improved some things