solve Number type problem: Integer -> Double
Change Integer to Double to match type
fix bugs to compile