implementet second score and transformed the program structure