Updated code with latest additions/fixes - 1/7/13