update grid lib, reimplement example