added detection of missing parameter, added comments