made code more pythonic
removed unused namedtuple