hrm, time to rewrite the entire thing in a better language