Cleaned up random event code