add cal A and b, not fully tested