use srcDir function and rename variables slightly more logically