My stab at a Swift implementation of JBModel