Version 3 
Changes mainly to adapt the code to the Eclipse environment.