now we don't crash as often, plus we calculate the correct rectangle