adding buffer stuff, and catching undefined ledger condition
Merge pull request #4 from afrank/master

adding buffer stuff, and catching undefined ledger condition