Strings in flat space and pp waves from N = 4 super