implemented physics. Some bugs are needed to be fixed