Added class comments and couple bug fixes