Fixed bugs and added edit and delete