changed a prototype to function