copied DS code in effort to learn this