Added working code to file