end of P04, some improvements left
fixed a bug