more functions, module split, fixes