merging in changes. web interface almost working. needs refactoring