Fixed and refactored Mac Implementation.