Refactored some of the state functions, and got the transparency to actually work.