updated with a little bit more inteligence
cleanup and bumped the version number