Implements the complete() function