removed extraneous size calculation from render function