renamed variables and changed a few comments
implemented scale bar for the ld plot
fixed index bug at the ld plot