tried to separate intialization from rendering