Encoding Reality - Prediction-Assisted Cortical Learning Algorithm in Hierarchical Temporal Memory