Working version

Two triggers dependant on tables not created in this file. Other than
that, the rest ought to be working