final version of the code
final