code updates and commenting