Neural Network algorithm for the machine learning course