application compiles, minor logic changes