added code and commented the hell out of it