Add almost working code