fix bugs, add basic construct