Commented and cleaned up