Trying to create a correct POST algorithm