Tyler's commented version