code cleanup... much comments