fought recursion to allow the rendering of more complicated files