Replaced foreach with cellfun.
Added gitignore.