I think it is working all now, but it needs some cleaning of code and structure.