added wrapper for arbitrary input from table
bugfixes...

Fixed errors in function calls, malloc instead of alloca (don't blow the
stack).