debugging, fixed box elimination bug & off-by-one errors