paper chase demo refactored and extended