Start modularising the functions: add() function