change all functions to static
add test in Makfile