Kiarash's code

Modified