Added missing return to the double function