merged changes from master with a few developments on top of that