initial code check-in; needs refactor