made recursive step more concise