Reimplement calculate heal table.

Signed-off-by: Konctantin <gawrilyako@gmail.com>