added new rect hist algo