debut boundary check
more on boundary checks + minor corrections in constant.h