got a working code going