Added max heigh (which does not work) and small modifications to the programs