Changed some pixel based calculations