Database done

Database done but i probably broke functionality