fixing bugs; adding reorder