made cont() function esier to understand