added edit function, still needs work