working inverse solver