improving the algorithm notes for brew master