completely reworked logic here

much smoother now