works for some equations