Added action counts and end action (unfinished)