added root argument and directory