improved comments and variable naming