Added latest version of the code