reorganized and fixed several issues with checksum validation