implemented cached (inverted) matrix