Made this a while back for my hub, pretty bad code