Began work on render function