Mostly working

Seems to work without any problems but outputted tickets are not sorted
properly