added init pass and reworked rendering