added gameplay logic