merge with anton's latest patch
add frame based capability