Pseudo Code added.