added fork and corrected some minor mistakes