sort out dependencies