optimazed version
merged and new edit buttons