changes thanks to sasa's review