modularize
working prototype