Added csv file writing
Fix maxage option