added steps parameter + refactoring