made the inverover algorithm independent of the weight matrix