A mathematical model for storage and recovery of motor actions in the spinal cord