Rewrote structure. Now class oriented.