Diving the script in 3 files, adding code for 3 class computation.