revamped; sha1 implemented; clean up;