added pell's equation