Added type form back in. Cleaned up code.