improved function signatures to prevent gross memory allocation