add doc strings
add main loop