mproved version - handling of manual function input and result console added