removed some uneeded code. added some code for debuging.