Added function paramter handling
Added output redirection to file