modified for variable key words