Rewrote most of the system