Changed code to use methods for Option, added lifetime for build_kd_tree.