added parameters -s and -h. Better errormessages.