Updated feature generating code