Update Database.java

fixed several bugs and changed the format of the DB a little bit so that it would work better.