Rearranged, fixed some bugs