added iPad support and fixed insets