speed optimization by using only one canvas