Changed function syntax to make more sense