found better implementation of md5
more cleanups