Modifying the ComplementTypes scala class

First attempt to change this task logic.