A customizable virtual reality framework for the rehabilitation of cognitive functions