Cleaned up script