Logic Fixes

Fixed the logic to allow for implementation of my learning algorithm