variable names modified. Comments on functions.