code now deals with vocabulary and outputs vocabulary in log