adding working and non working code