update for VS2013
comments

comments to make sense of some things and also to neaten up the code