Revert back to more working code