added constants.py, more "pythonic" etc