added some gameplay logic