implemented closest memento function. removed useless files