completely reworked. Uses thor now