lot of changes/fixes