database parameters are now handled as shell script input; introducing R scripting; db connection made globa