Working code with integration
merge fixes