Finalised structure management prototype script, need to implement it on the field.