Cleaned up C Code for more function abstraction. Added HW status checking by sending in a dimension of <= 1