finished most of the code for how it works, need to test