fixed problem with slow down on rendering. The problem was the amount of context switches involved in it