complete implementation of Needleman-Wunsch algorithm. add docstrings to functions. remove globals.