implementation without metric; not tested;