working on running external function dynamically - still buggy