Updated comment and cleaned up some codes