Remove unecessary libraries. Add a comprehensive regex. Fix print statements.