Updated to use latest changes with the library; remove frovilous use of ints