takes started some edge cases not accounted for