The original code can be found here.