diff --git a/src/Form/UserQueueViewForm.php b/src/Form/UserQueueViewForm.php
index 07dffaf..9bbca40 100644
--- a/src/Form/UserQueueViewForm.php
+++ b/src/Form/UserQueueViewForm.php
@@ -57,6 +57,27 @@ class UserQueueViewForm extends FormBase {
    * {@inheritdoc}
    */
   public function submitForm(array &$form, FormStateInterface $form_state) {
-    
-  }
-}
\ No newline at end of file
+   
+
+		 $current_path = \Drupal::service('path.current')->getPath();
+	    	 $path_args = explode('/', $current_path);	   
+	
+			   
+		
+		$queryn = db_select('userqueue_user', 'uu');
+		$queryn->addExpression('MAX(weight)', 'weight');
+		$position = $queryn->condition('uqid',$path_args[4],'=');
+  		$position = $queryn->execute()->fetchField();
+
+		
+		
+		db_insert('userqueue_user')
+		->fields(array(
+		'uqid' => $path_args[4],
+		'uid' => $form_state->getValue('username'),
+		'weight' => $position+1,		 
+		))
+		->execute(); 
+ 
+ }
+}
