Development and implementation of an intelligent flexible manufacturing system