Last version, includes changes in the simple action generation, and some corrections in the rest of the implementation