Changed function into returning