Adding implementation of first iteration