added writeSale() to finish off ticket sales. now for the query method