Updated code 

Updated code for part of the issue #2