removed some indexes from functions and eliminated unnecessary calls to the original dataset array