converted some scripts to ruby