make In Out invariant, minor edits, review shapeless stuff