Class rewrite, not sure what I rewrote 100%