Added GenerateCRC function