Was able to fix the triggers/queries to produce the correct results;
The timing is not implemented yet.