Various changes to work with larger dataset