Restructured the codes as preparation for implementing the gravity