rearranging and adding some comments