added multiple key-frame support