Included missing global values needed in function