added additional sql functions