Adding better error handling.
Some bugs fixed, try to simplify code as much as possible.
Reduce runtime by using faster block search.
Some testing done and added to make sure everything works.