added some comments and type fixes in comments