adding a complement function and adding the tests to prove that it works