changed 'var' keyword for 'let', it has a better functional approach