Major improvements for iterating procedure and bug fixes