corrected small errors and removed functions using the old model