solving inverse of proplem