the core business logic about xys,the first attempt.