added precompute function
update readme