added a few comments and changed a couple of parameters