Initial commit
* more refactoring
* averaging error rate