Finished new edit, add flags to layout