added tests and gameplay logic in models