updated action_state_margin to use caching, fixed some smalle bugs