added last sample analysis