Holy code, it works