updated to include buffer constraints