partial snake code