Updated for personal use.