rearranging bug fixed