Got order correct while populating the ticket information. Cleaned up code a bit.