small changes to hopefully alleviate memory issues