Update commit with improviments

Improvements in the source code  structure, using 'function'.