added purchases and sales code and cleaned up nav