alternative way to implement snake game