added expiry check; implemented all required methods