fix matrix operations

add new reverse matrix computing method
and some more stuff