start to implements eps and fix some errors