First attempt
Fixed the bug!
Added an accounting feature