Updated checksum function and added command constants