compiled working now :), still next to extend to multiple frames working on same layer
extended new pointer creation to other functions