Cleaning update

did some cleaning on the code.