Removed code repetition

*modified binary definition to be class-wide
*moved repetitive code from separate test functions into a
CalculateUserInput() function