Added navigation and cleared up code