3D gait assessment in young and elderly subjects using foot-worn inertial sensors