uff back to working version - refactor in progress