Changed table names. Partial change of some function names and key names.