added extern declarations and implemented checking position inference.