updating out in displaythread for supporting timing simulation
some code refactoring