Changed loading and savind database
made it more neat