Initial Swift Implementation