updated hog.py with winning algorithm