Restructuration and added code for Unit 5.4