updated to ruby script + cleaned up output