This is UNFINISHED I got to do more work on this.But you can check out the code.But right now it only stops when it get's to Max.