fix global var
self init parameters
semi-working pipeline