snake implemnetation work