some edits and rearranging