Adding support for unbounded vars. Refactored to eliminate unnecessary special cases and allow unbounded vars.