added perhaps and slightly better regex
fixed a few bugs