commented and cleaned up