Climate change legislation passed by MSPs