added tie check and tests