Code from to blog entries.