snakes perfect

using only function