near completion - all functionality added
improved data sampling