Fixed patching and made hashing algorithm a lot faster