Some improvements and added the bill stuff for debugging.