Implemented some swift and fixed errors
update