modified trigger function to id phases based on max id and NOT the count of ids (so that we can remove intermediate phases)
added ability to delete phases
had to move these to separate file to get 2_phases.sql to run, not sure why yet