possibly found huge mistake when starting on backwards algorithm