redoing data model and fixing a bug