Implemented a way to do nano time if necessary and corrected endianness, also some code cleanup