cleaned up code in dispmodel