Added use strict and cleaned code