- revised the code