Base src code commit

Converted and fixed for visual studio 2010