Updated version. Cleaned up.