Fixed Bug that causes the A matrix to be wrong
Fixed Bug in viewer