Automatic construction of temporally extended actions within the options framework