added edit button and list generating function