THe purpose? I don't think the purpose of the whole town is understood fully. Some guides spout human sacrifice, others give educational explanations. Whatever it was, it was only operational for around a hundred years before the general area was taken over by the Spaniards and although the site itself wasn't discovered and over-run by the Conquistadors, the population was decimated and the area ceased being used and developed. Seemingly, there are landmarks which have astronomical references - spots where the sun rises at the solstice and whatever, so clearly there was an astronomical relevance. Always, training of the next generation is of importance, so a focus on education can be taken 'as read'. The terraces? Places to sit for observation? crops, herbs/ Not known. Massive investment of energy for it to have been this big after so short a time in such challenging terrain.