added scala functional graph impl - incomplete!