Slight rework, referer figures out its own stuff