Now uses Listdir instead of the primitive functions