min and max elements added