Working version of snake