added checksum func(untested)