some cleaning, added comments