crc functions reworked