delete temp file =)

and some clean code + comments