Updated to work with new SDK and use blocks. Nom nom nom.