semi-final codes added