adds @count variable and fixes indent