added accidental functionality and refined tie behavior