remodeled schema, added new functions in views and controllers