adding phase recognition