several bugs fixed, many warnings solved (most of them solved by adding hasOwnProperty), new file output added.