Rewrote most of the basic glue