complete in a way, need to do the code optimiazation