First attempt at making database work