almost done

with bug to kill and some improvement should be done