small bug and add comments