added renderer and changed init code