Advanced functions solution added.