worked
minimize code