Added new type, cleaned up code a bit.