add getCost snippet