removing redundant functions. replaced with improved ones.