dependancy solution, TODO: revise to DAG
DAG version, however unknown reason still WA