new render
add win/loose conditions
final version
added some comments and optimizations
new structure
clean up