A wearable inertial sensor system for gait and balance monitoring