Modified for personal use.