wrote some swift. don't know what I'm doing