Added log functionality and worked on tree gen