Montecarlo in general basis I: remove the ifs, put them into comments