* updated according to code review
* updated comments
* changed all uint64_t to int64_t
* sorted header