rewritten changeCheck function
small cleanups