Started work on algorithm