SECOND VERSION (without Arduino)