runs but does not give correct answer for part 2
done with part 2 (coding only, no perf analysis)