lots of commenting + improvements