It seems the person who wrote candy box wrote a second more sophisticated version of it.