Working buildata() function. This function builds hierarchical source in footer.html