added os identification; output change; minor optimization