use LLAMA's internal feature cost handling, fix some bugs, better testing