Removed input molestation and code cleanup.