Changing from concommand to function