A simple implementation of the NDP algorithm