Changed some return types to void (output now with parameter by reference).