Modified name of variables

//TODO: optimizing the algorithm without reusing code from requirement.