bug maybe fixed
start optimizaiton