determinewinner func added and tested