Added Nathan's Pygment changes and cleaned up code