added the initial working code