second simpler implementation

more object oriented implementation
recalculates inverse when solve parameters change