added edit/update funcionality and fixed some minor problems