added some leafes and loader code