cleaned up model code (without testing of course)
removed some silly code