Working pull from the database

Ugly, but working commit.