Porting JM to swift and taking it to the next level