implemented tie checking