changed from objects to functions