working on computer algorithm