shortened some lines
didn't change any algo