push button code - missing purpose

It seems very well commented. Which part are you having trouble with?