update code
added program to write features to file

a few code refactor to improve readability