slight optimisations : remove unsued, function, statify some calls, remove unreachable code
minor format changes on xls sheet