fix plotting; still buggy