Documented and cleaned up