New grammar version. Added the main function and the for. Modifications in all the grammar to do it more clear