refactored terr model mod and adding sorting func. extended K with marker view state funcs