started integrating dispatch and external code into prototype