implemented contextual short-term memory