updated to 3.5 compliance. sketchy as hell, but working