removed dead code.
solved promblem two ways. one of them i like.