edited some code