MIDCODE acomplished
all done, need optimize
em