better testing; handles more 'value' type vars; macros for code conciseness in c source