Revert "Optimized some code and made slowhazard work better"

This reverts commit 524687f613177ed6b0dd86249c4ce5ee4cf8846b.
Revert "Revert "Optimized some code and made slowhazard work better""

This reverts commit 90c5cc2cfc3aa56971c723d06e2453c0ebb19f1f.