Commit on first stage

This will be optimized because it was extracted from a working system
and need to fix some stuff