use strict and some other minor corretions