Changed the outHeight calculation to include margins.