Global functions working for now, pretty hacky