new subject function classes added and some other db functions refined