fixed cmd lines, functions written