Edited out irrelevant parts.