database scripts+ minor changes