added more preprocessing