change margin calculations to percentages so they work better with different size tablets