cleaned up code a bit, made md5_extend more similar to sha1_extend