write features into file