move mask drawing into render_loop
remove unused variables