Adding simple when implementation