changes file statuses from 644 to 755
refactored algorithm implementation and fixed several bugs