Implemented closest method