Add beancounting function