Updated dependency logic; Made output more consistent