added resort functionality and remove from iteration ability