switched the attachment code to use a switch in preperation for a less limited attachment system