added function to model to make model generally useable for all tables