Fixed to use delegates properly.