Second working code