Wrote loader code