bug fixed and a bit commenting