new problem, moderately difficult but needs refactoring