remove debug
re-write to use queues
general improvements
indent fix
Improve chainbuilder