edit feature added, however needs code re-factoring and bug fixing