improved fluid code a bit