various changes that make it partly work on ipad
merge conflict