Cleaned up a bit, added comments and more triggers