switched to exit because break only leaves inner loop
bad shape implementation