window sizing reimplement