adding loader code. Sort of works. ish