From rote learning to Enhanced learning

In my previous PR I hacked out a way to just make the machine rot learn without any thresholds or meaningful(almost no) heuristics. In this PR, the machine learns with proper prototype threshold values.