More logic added.