code optimization  v 0.1