updated for swift v1.1