A rewrite
Another re-write, using enums instead of structs