added double function, because go can't handle double return values