made function static and added it to head