Cleaned up and paramatized.