added initial working code