Coding a BAC calculator