fix negative and inverse