merge with hogwild
added int->long conversion for variables