add path trace and change arrays to sets to speed things up