added calculate weight with and without LUT...LUT version is currently segfaulting yay. Both are also slow so maybe we can look into parallelizing?