Added footer formatting and cleaned up code