testing alternatives to optimize algorithm