Implemented if control flo