snake implemented