use num type instead of double