initial commit of new, refactored code