major progress but not working yet