started to implement triggers. Broken and too tired to continue.