Trying to straighten up the code a bit still having problems with some error causing the app to crash.