added NotImplementedError where appropriate
reformated everything using reindent.py