updated to cover pending payments etc.