app logic additions. needs cleanup