working nicely with database