Enhanced documentation, changed variable names