some aaem-related code for frames added (unfinished)