add main functionality
add unit test