history functional
merged with master