Working version
merged