Got a semi workable plugin now.