remove unused code and fixed frechet test