U.S. military developing brain device to restore memory