some edits to make faster