Change contextWords function, formatting fixes