More code can be found here.