A matching engine to simulate stock trading on exchange