working foreach
working now