Implemented ifs and added some samples and tests.