changed bits of code to be more akin to othe XBlock examples I saw