need freeing functions in swap and frame pls thx