adding ui and win logic