added render function
inlined
adapted to new render