added basic algorithm implmemantion