Modified several pieces of code. Work in progress. Don't attempt to run the app.