major rewrite of biglogic