Optimization -- got rid of dyn variables