Adding speed, estimated time and code refactoring of Sample code