Cleaned up code (only slightly). Removed unnecessary GUI features.