Model changes

globals are removed from code. Please have a look !