crc8 added. code refactored