Ok now works. Still have to debug it fully