improve UP + fixing semantic bugs