add query and create function for gas cost category