syntactic changes from comments by @damianavila