Implements function