functions static where possible, remove unused prototypes.
Attach a file by drag & drop or click to upload