checksu function