tidied up merge