Step-by-Step Guide to Writing a Machine Learning Algorithm