Variable name corrected

Variable name corrected and some missing functions added.