Improvements

Code refactor - removed tabs, only spaces are used, rewritten a couple of functions.

Removed warnings during compilation and running of the tests.