Code works with sample 2