Adding working code to repo