final code for version 1.0 of the aplication