various changes mainly to parameters
loads of changes
merge: