Added inputlistener and fixed constructor for turnphase