compilation now reports only one set of error messages
added guard refinement