cleaned up debugging and code cosmetics