added third iteration of grainburn algorithms. Third time's the charm.