bug fixing... Not sure if works
merge conflicts resolved