Added first draft fo the fucking algorithm