not sure why printing causes memory issues