refactoring: retrieves letter elements in a more functional fashion + stores json in data-positions attribute