database sorted out