Code ready to sample angles. Bugs haven't been tested