added while loop
function defs, returns and calls