Integrated whole code - code is working