Create a function to deal with both X @  @ cases
Rename stuff
Use better logic for @@