initial work for issue 399

not ready for merging
not refactoring; this is from autopep8