add slap to avoid using built-in function similar to the point of the exercise.