added detection of missing parameter, added comments
fixed formatting blip