Added some comments, improved some code, added config for changing Endianness