implementing Stack in Swift