Medical device that tracks brainwaves and helps people recover from neurological conditions such as strokes