Version 2

Second version of the code.