starts work on flatten