implemented new hiearchy and tested, works well