Implementation of common algorithm for self learning purpose