fixed script to have better output