fixed constraint issue, added struct view

turns out it was because my mid/max constraints were wrongly passed to
the constraint function...