added comments + rearranged some pieces