comment modified
added foreach method