fix the bug and refactor for self placement and general study