Removed old debuggin code. Tidied up the database connection a bit. Did some work on the database