Added Media Source and cleaned up code format