simplified the use of bytes_swap() for easier readingg