fixed all substitute methods to get rid of bounded variables