Use implode instead of foreach