             return
         }
         
-        let user = session.user
-        let path1 = "users/\(user.id)/profile/following_count"
-        let path2 = "users/\(user.id)/following/\(id)"
-        let path3 = "users/\(id)/followers/\(user.id)"
-        let path4 = "users/\(id)/profile/followers_count"
-        let path5 = "users/\(user.id)/feed"
-        let path6 = "users/\(id)/feed"
+        let uid = session.user.id
+        let path1 = "user-profile/\(uid)/following_count"
+        let path2 = "user-following/\(uid)/following/\(id)"
+        let path3 = "user-follower/\(id)/followers/\(uid)"
+        let path4 = "user-profile/\(id)/follower_count"
+        let path5 = "user-feed/\(uid)/posts"
+        let path6 = "user-feed/\(id)/posts"
         
         let rootRef = FIRDatabase.database().reference()
         let followingCountRef = rootRef.child(path1)

            return
        }
        
        let user = session.user
        let path1 = "users/\(user.id)/profile/following_count"
        let path2 = "users/\(user.id)/following/\(id)"
        let path3 = "users/\(id)/followers/\(user.id)"
        let path4 = "users/\(id)/profile/followers_count"
        let path5 = "users/\(user.id)/feed"
        let path6 = "users/\(id)/feed"
        
        let rootRef = FIRDatabase.database().reference()
        let followingCountRef = rootRef.child(path1)

        let feed1Ref = rootRef.child(path5)
        let feed2Ref = rootRef.child(path6)
        
        followingRef.observeSingleEvent(of: .value, with: { (followingSnapshot) in
            guard !followingSnapshot.exists() else {
                error = .failedToFollow(message: "Already followed")
                callback?(error)
                return
            }
            
            followingCountRef.runTransactionBlock({ (followingCountSnapshot) -> FIRTransactionResult in
                if let val = followingCountSnapshot.value as? Int , val > 0 {
                    followingCountSnapshot.value = val + 1
                    
                } else {
                    followingCountSnapshot.value = 1
                }
                return FIRTransactionResult.success(withValue: followingCountSnapshot)
                
                }, andCompletionBlock: { (err, committed, snap) in
                    guard committed else {
                        error = .failedToFollow(message: "Failed to follow")
                        callback?(error)
                        return
                    }
                    
                    followerCountRef.runTransactionBlock({ (followerCountSnapshot) -> FIRTransactionResult in
                        if let val = followerCountSnapshot.value as? Int , val > 0 {
                            followerCountSnapshot.value = val + 1
                            
                        } else {
                            followerCountSnapshot.value = 1
                        }
                        return FIRTransactionResult.success(withValue: followerCountSnapshot)
                        
                        }, andCompletionBlock: { (err, committed, snap) in
                            guard committed else {
                                error = .failedToFollow(message: "Failed to follow")
                                callback?(error)
                                return
                            }
                            
                            feed2Ref.observeSingleEvent(of: .value, with: { (feed1Snapshot) in
                                if let feed1 = feed1Snapshot.value as? [AnyHashable: Any] {
                                    feed1Ref.updateChildValues(feed1)
                                }
                                
                                followingRef.setValue(true)
                                followerRef.setValue(true)
                                
                                callback?(nil)
                            })
                    })
            })
        })
    }
