Modified to take md5 hash as well