add #defines for compile errors
valgrind pointed out allocated memory in exception cases
valgrind pointed out invalid memory access if no input
first stab at ibeta