Started adding unit tests. Also changed qId to orderID and tId to firmId
for the sake of readability