converted from sequence processing to db processing, deleted unused functions