changing function to static