Implemented Sample Alogithm