Implement all main logic for Mac