script re-written
small adjustments + min file