Better hash handling, more if/else checks and tests
More tests