added comments but have not fully tested them, perhaps they should be optional...