changed num from int to double