This code was also not written by me.